package net.exoweb.animate.graphics
{
    import flash.events.*;

    import net.exoweb.animate.graphics.*;

    public class GScreen extends GShape
    {
        public function GScreen(color:uint=0xFFFFFF, bm:String="normal")
        {
            super(color, bm);

            var nail:GNail = new GNail(color, 0);
            nail.display();
            nail.x = 130;
            nail.y = 200;
            nail.scaleX = 1.5;
            nail.scaleY = 1.5;
            addChild(nail);
            nail = new GNail(color, 0);
            nail.display();
            nail.x = 310;
            nail.y = 200;
            nail.scaleX = 1.5;
            nail.scaleY = 1.5;
            addChild(nail);

            nail = new GNail(0, color);
            nail.display();
            nail.x = 340;
            nail.y = -200;
            nail.scaleX = 3;
            nail.scaleY = 3;
            addChild(nail);
        }

        public function rotateFan(e:Event):void
        {
        }

        override public function display():void
        {
            graphics.clear();
            graphics.beginFill(color, 0.5);
            graphics.moveTo(-340, -180);
            graphics.lineTo(-320, -210);
            graphics.lineTo(-120, -210);
            graphics.lineTo(-110, -200);
            graphics.lineTo(-10, -200);
            graphics.lineTo(0, -190);
            graphics.lineTo(10, -200);
            graphics.lineTo(320, -200);
            graphics.lineTo(340, -180);
            graphics.lineTo(340, -10);
            graphics.lineTo(330, 0);
            graphics.lineTo(340, 10);
            graphics.lineTo(340, 180);
            graphics.lineTo(320, 210);
            graphics.lineTo(120, 210);
            graphics.lineTo(110, 200);
            graphics.lineTo(10, 200);
            graphics.lineTo(0, 190);
            graphics.lineTo(-10, 200);
            graphics.lineTo(-320, 200);
            graphics.lineTo(-340, 180);
            graphics.lineTo(-340, 10);
            graphics.lineTo(-330, 0);
            graphics.lineTo(-340, -10);
            graphics.endFill();

            graphics.beginFill(0, 0.8);
            graphics.drawRect(-310, -200, 180, 10);
            graphics.endFill();

            graphics.beginFill(color, 1);
            graphics.drawCircle(340, -200, 20);
            graphics.endFill();

            graphics.beginFill(0, 0.8);
            graphics.drawRect(-320, -180, 640, 360);
            graphics.endFill();

            graphics.lineStyle(3, 0, 0.8);
            for(var i:int=0; i<60; i+=10)
            {
                graphics.moveTo(230+i, 190);
                graphics.lineTo(240+i, 200);
            }
        }
    }
}
